package com.example.mybatis.Service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.mybatis.Pojo.Exam;
import com.example.mybatis.Service.ExamService;
import com.example.mybatis.mapper.ExamMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements ExamService {

    //通过学号查询考试信息
    public List<Exam> getExamListByUsername(String username) {
        QueryWrapper<Exam> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("username", username);
        return list(queryWrapper);
    }
}
